$(document).ready(function () {


    var dajindai = {
        "loansAmount": {
            "data": [
                "2万",
                "3万",
                "5万",
                "8万",
                "10万",
                "20万",
                "30万",
                "50万",
                "100万及以上"
            ],
            "setData": [
                "20000",
                "30000",
                "50000",
                "80000",
                "100000",
                "200000",
                "300000",
                "500000",
                "1000000"
            ]
        },
        "loansAmounttime": {
            "data": [
                "3个月",
                "6个月",
                "12个月",
                "2年",
                "3年",
                "5年及以上"
            ],
            "setData": [
                "3",
                "6",
                "12",
                "24",
                "36",
                "60"
            ]
        },
        "loanUse": {
            "data": [
                "消费贷款",
                "其他贷款",
                "过桥贷款",
                "教育贷款",
                "装修贷款",
                "购房贷款",
                "购车贷款"
            ],
            "setData": [
                "8",
                "10",
                "9",
                "5",
                "4",
                "3",
                "2"
            ]
        },
        "identity": {
            "all": [
                "上班族",
                "个体户",
                "电商主",
                "自由职业者",
                "企业主"
            ],
            "setData": [
                "1",
                "2",
                "3",
                "4",
                "5"
            ],
            "office": {
                "office_name": "上班族",
                "office_workType": {
                    "data": [
                        "私营企业",
                        "国企单位",
                        "事业单位",
                        "公务员",
                        "其他"
                    ],
                    "setData": [
                        "1",
                        "2",
                        "3",
                        "4",
                        "6"
                    ]
                },
                "office_payType": {
                    "data": [
                        "银行代发",
                        "转账工资",
                        "现金发放",
                        "自由职业收入"
                    ],
                    "setData": [
                        "1",
                        "2",
                        "3",
                        "4"
                    ]
                },
                "office_time": {
                    "data": [
                        "6个月以内",
                        "6-12月",
                        "1-3年",
                        "3-5年",
                        "5年以上"
                    ],
                    "setData": [
                        "1",
                        "2",
                        "3",
                        "4",
                        "5"
                    ]
                },
                "sb_income": {
                    "data": [
                        "1000以下",
                        "1000-3000",
                        "3000-5000",
                        "5000-8000",
                        "8000-1.2万",
                        "1.2万-2万",
                        "2万-5万",
                        "5万-10万",
                        "10万以上"
                    ],
                    "setData": [
                        "1000",
                        "3000",
                        "5000",
                        "8000",
                        "12000",
                        "20000",
                        "50000",
                        "100000",
                        "150000"
                    ]
                }
            },
            "individual": {
                "name": "个体户",
                "time": {
                    "data": [
                        "6个月以内",
                        "6-12个月",
                        "1-3年",
                        "3-5年",
                        "5年以上"
                    ],
                    "setData": [
                        "1",
                        "2",
                        "3",
                        "4",
                        "5"
                    ]
                },
                "gt_income": {
                    "data": [
                        "1000以下",
                        "1000-3000",
                        "3000-5000",
                        "5000-8000",
                        "8000-1.2万",
                        "1.2万-2万",
                        "2万-5万",
                        "5万-10万",
                        "10万以上"
                    ],
                    "setData": [
                        "1000",
                        "3000",
                        "5000",
                        "8000",
                        "12000",
                        "20000",
                        "50000",
                        "100000",
                        "150000"
                    ]
                },
                "licence": {
                    "data": [
                        "无",
                        "已办理，注册6-11个月",
                        "已办理，注册满1年",
                        "已办理，注册满2年",
                        "已办理，注册满3年",
                        "已办理，注册满4年",
                        "已办理，注册满5年以上"
                    ],
                    "setData": [
                        "1",
                        "2",
                        "3",
                        "4",
                        "5",
                        "6",
                        "7"
                    ]
                },
                "pos": {
                    "data": [
                        "否",
                        "使用6个月以内",
                        "使用6-12个月",
                        "使用1-3年",
                        "使用3-5年",
                        "使用5年以上"
                    ],
                    "setData": [
                        "0",
                        "1",
                        "2",
                        "3",
                        "4",
                        "5"
                    ]
                },
                "gt_pos_income": {
                    "data": [
                        "5万以下",
                        "5万-30万",
                        "30万-100万",
                        "100万-1000万",
                        "1000万以上"
                    ],
                    "setData": [
                        "50000",
                        "300000",
                        "1000000",
                        "10000000",
                        "15000000"
                    ]
                }
            },
            "ec": {
                "name": "电商主",
                "platform": {
                    "data": [
                        "京东",
                        "淘宝",
                        "天猫",
                        "当当",
                        "ebay",
                        "amazon",
                        "其他"
                    ],
                    "setData": [
                        "1",
                        "2",
                        "3",
                        "4",
                        "5",
                        "6",
                        "7"
                    ]
                },
                "time": {
                    "data": [
                        "6个月以内",
                        "6-12个月",
                        "1-3年",
                        "3-5年",
                        "5年以上"
                    ],
                    "setData": [
                        "1",
                        "2",
                        "3",
                        "4",
                        "5"
                    ]
                },
                "licence": {
                    "data": [
                        "无",
                        "已办理，注册6-11个月",
                        "已办理，注册满1年",
                        "已办理，注册满2年",
                        "已办理，注册满3年",
                        "已办理，注册满4年",
                        "已办理，注册满5年以上"
                    ],
                    "setData": [
                        "1",
                        "2",
                        "3",
                        "4",
                        "5",
                        "6",
                        "7"
                    ]
                },
                "ds_income": {
                    "data": [
                        "1万以下",
                        "1万-5万",
                        "5万-20万",
                        "20万-100万",
                        "100万-1000万",
                        "1000万以上"
                    ],
                    "setData": [
                        "10000",
                        "50000",
                        "200000",
                        "1000000",
                        "10000000",
                        "15000000"
                    ]
                }
            },
            "company": {
                "name": "企业",
                "companyType": {
                    "data": [
                        "中型企业-年收入5000万以上",
                        "中小型企业-年收入500万-5000万",
                        "小微型企业-年收入500万以下",
                        "个体户"
                    ],
                    "setData": [
                        "6",
                        "7",
                        "8",
                        "9"
                    ]
                },
                "time": {
                    "data": [
                        "6个月以内",
                        "6-12个月",
                        "1-3年",
                        "3-5年",
                        "5年以上"
                    ],
                    "setData": [
                        "1",
                        "2",
                        "3",
                        "4",
                        "5"
                    ]
                },
                "qy_income_public": {
                    "data": [
                        "5万以下",
                        "5万-30万",
                        "30万-100万",
                        "100万-1000万",
                        "1000万以上"
                    ],
                    "setData": [
                        "50000",
                        "300000",
                        "1000000",
                        "10000000",
                        "15000000"
                    ]
                },
                "qy_income_private": {
                    "data": [
                        "1万以下",
                        "1万-5万",
                        "5万-20万",
                        "20万-100万",
                        "100万以上"
                    ],
                    "setData": [
                        "10000",
                        "50000",
                        "200000",
                        "1000000",
                        "1500000"
                    ]
                },
                "licence": {
                    "data": [
                        "无",
                        "已办理，注册6-11个月",
                        "已办理，注册满1年",
                        "已办理，注册满2年",
                        "已办理，注册满3年",
                        "已办理，注册满4年",
                        "已办理，注册满5年以上"
                    ],
                    "setData": [
                        "1",
                        "2",
                        "3",
                        "4",
                        "5",
                        "6",
                        "7"
                    ]
                }
            },
            "freelance": {
                "name": "自由职业者",
                "zy_income": {
                    "data": [
                        "1000以下",
                        "1000-3000",
                        "3000-5000",
                        "5000-8000",
                        "8000-1.2万",
                        "1.2万-2万",
                        "2万-5万",
                        "5万-10万",
                        "10万以上"
                    ],
                    "setData": [
                        "1000",
                        "3000",
                        "5000",
                        "8000",
                        "12000",
                        "20000",
                        "50000",
                        "100000",
                        "150000"
                    ]
                }
            }
        },
        "visa": {
            "data": [
                "无信用卡",
                "3000元以下",
                "3000-10000元",
                "10000-30000元",
                "30000元以上"
            ],
            "setData": [
                "0",
                "3000",
                "10000",
                "30000",
                "30001"
            ]
        },
        "wld": {
            "data": [
                "无微粒贷",
                "500-1000元",
                "1000-3000元",
                "3000-5000元",
                "5000-1万",
                "1万-3万",
                "3万-5万",
                "5万-10万",
                "10万-15万",
                "15万-20万",
                "20万-30万"
            ],
            "setData": [
                "0",
                "1000",
                "3000",
                "5000",
                "10000",
                "30000",
                "50000",
                "100000",
                "150000",
                "200000",
                "300000"
            ]
        },
        "localsocialsecurity": {
            "data": [
                "无本地社保",
                "连续缴纳3个月",
                "连续缴纳6个月",
                "连续缴纳1年",
                "连续缴纳3年",
                "连续缴纳5年以上"
            ],
            "setData": [
                "0",
                "3",
                "6",
                "12",
                "36",
                "60"
            ]
        },
        "providentfund": {
            "data": [
                "无本地公积金",
                "连续缴纳3个月",
                "连续缴纳6个月",
                "连续缴纳1年",
                "连续缴纳3年",
                "连续缴纳5年以上"
            ],
            "setData": [
                "0",
                "3",
                "6",
                "12",
                "36",
                "60"
            ]
        },
        "car": {
            "data": [
                "无车产",
                "有车，已抵押",
                "有车，未抵押"
            ],
            "setData": [
                "0",
                "1",
                "2"
            ]
        },
        "carappraisement": {
            "data": [
                "5万及以下",
                "10万",
                "15万",
                "20万",
                "30万",
                "50万",
                "80万及以上"
            ],
            "setData": [
                "5",
                "10",
                "15",
                "20",
                "30",
                "50",
                "80"
            ]
        },
        "house": {
            "data": [
                "无房产",
                "有房，已抵押",
                "有房，未抵押"
            ],
            "setData": [
                "0",
                "1",
                "2"
            ]
        },
        "houseType": {
            "data": [
                "商品住宅",
                "商铺",
                "办公楼",
                "厂房",
                "经济限价房",
                "房改/危改房",
                "按揭房"
            ],
            "setData": [
                "1",
                "2",
                "3",
                "4",
                "5",
                "6",
                "7"
            ]
        },
        "houseTime": {
            "data": [
                "10年以下",
                "10-20年",
                "20-25年",
                "25-30年",
                "30年以上"
            ],
            "setData": [
                "1",
                "2",
                "3",
                "4",
                "5"
            ]
        },
        "houseValue": {
            "data": [
                "50万及以下",
                "100万",
                "200万",
                "300万",
                "500万",
                "1000万及以上"
            ],
            "setData": [
                "50",
                "100",
                "200",
                "300",
                "500",
                "1000"
            ]
        },
        "insurance": {
            "data": [
                "无人寿保险",
                "6个月以内",
                "6-12个月",
                "1-3年",
                "3-5年",
                "5-10年",
                "10年以上"
            ],
            "setData": [
                "0",
                "1",
                "2",
                "3",
                "4",
                "5",
                "6"
            ]
        },
        "insurance_value": {
            "data": [
                "1万以下",
                "1万-5万",
                "5万-20万",
                "20万-100万",
                "100万以上"
            ],
            "setData": [
                "10000",
                "50000",
                "200000",
                "1000000",
                "1500000"
            ]
        },
        "insuranceCompany": {
            "data": [
                "安邦保险",
                "中国平安",
                "前海人寿",
                "中国人寿",
                "太平洋保险",
                "康泰人寿",
                "新华保险",
                "阳光保险",
                "招商信诺",
                "中国太平",
                "其他"
            ],
            "setData": [
                "1",
                "2",
                "3",
                "4",
                "5",
                "6",
                "7",
                "8",
                "9",
                "10",
                "11"
            ]
        },
        "connectionTime": [
            "不限时间",
            "工作日上班时间",
            "工作日下班时间",
            "休息日"
        ]
    };


    const localName = ["loansAmount", "loansAmounttime", "loanUse", "visa", "localsocialsecurity", "providentfund", "car", "carappraisement", "house", "houseType", "houseTime", "houseValue", "insurance", "insurance_value", "insuranceCompany"];

    const webName = ["money", "limit", "purpose", "credit_card_money", "sb_security", "sb_fund", "car", "car_value", "house", "house_type", "house_age", "house_value", "zy_insurance_time", "zy_insurance_value", "zy_insurance_company"];

    const localIdentityKey = ["sb_income", "gt_income", "gt_pos_income", "ds_income", "qy_income_public", "qy_income_private", "zy_income", 'sb_pay_type', 'sb_company_type', 'gt_company_age', 'gt_license', 'ds_platform', 'ds_company_age', 'ds_license', 'qy_company_type', 'qy_license', 'qy_company_age'];


    var localWebNameSize = webName.length;

    //______________________
    const argeCreditPureDescription = 'https://www.jiayiunion.com/creditUnion/largeCreditPureDescription/';
    const largeCredit = 'https://www.jiayiunion.com/creditUnion/largeCredit/';
    //______________________


    //处理大金贷

    function djd(obj) {
        // obj.beforeSend=myBeforeSend;
        obj.url = myUrlNoCache(obj.url);
        obj.success = function (data) {
            // changeCode(data);
            if (notNull(obj.mySuccess))
                obj.mySuccess(data)
        };
        $.ajax(obj);
    }


    // function myAjaxFuncJsonNotchangeToken(obj) {
    //     obj.beforeSend = myBeforeSend;
    //     obj.error = ling;
    //     obj.url = myUrlNoCache(obj.url);
    //     obj.data = JSON.stringify(obj.data);
    //     obj.contentType = "application/json";
    //     obj.success = function (data) {
    //         if (notNull(obj.mySuccess))
    //             obj.mySuccess(data)
    //     };
    //     $.ajax(obj);
    // }



    djd({
        url: argeCreditPureDescription + "getAllFieldDescription",
        type: "get",
        mySuccess: function (resp) {
            if (resp.success) {
                var map = resp.data.map;

                if (!isNull(map)) {

                    for (var i = 0; i < localWebNameSize; i++) {

                        var array = map[webName[i]];

                        if (!isNull(array) && array.length > 0) {

                            let fieldValueArray = [];
                            let fieldValue_descriptionArray = [];

                            for (var j = 0; j < array.length; j++) {

                                var item = array[j];


                                fieldValueArray[j] = String(item.fieldValue);
                                fieldValue_descriptionArray[j] = item.fieldValue_description;
                            }

                            var chooserItemAttribute = dajindai[localName[i]];

                            chooserItemAttribute.data = fieldValue_descriptionArray;
                            chooserItemAttribute.setData = fieldValueArray;

                        }
                    }

                    //identity的处理

                    var identity = dajindai.identity;

                    var localIdentity = {}

                    localIdentity.sb_income = identity.office.sb_income;
                    localIdentity.gt_income = identity.individual.gt_income;
                    localIdentity.gt_pos_income = identity.individual.gt_pos_income;
                    localIdentity.ds_income = identity.ec.ds_income;
                    localIdentity.qy_income_public = identity.company.qy_income_public;
                    localIdentity.qy_income_private = identity.company.qy_income_private;
                    localIdentity.zy_income = identity.freelance.zy_income;


                    localIdentity.sb_pay_type = identity.office.office_payType;
                    localIdentity.sb_company_type = identity.office.office_workType;
                    localIdentity.gt_company_age = identity.individual.time;
                    localIdentity.gt_license = identity.individual.licence;
                    localIdentity.ds_platform = identity.ec.platform;
                    localIdentity.ds_company_age = identity.ec.time;
                    localIdentity.ds_license = identity.ec.licence;
                    localIdentity.qy_company_type = identity.company.companyType;
                    localIdentity.qy_license = identity.company.licence;
                    localIdentity.qy_company_age = identity.company.time;


                    var localIdentityKeySize = localIdentityKey.length;

                    for (var i = 0; i < localIdentityKeySize; i++) {

                        var array = map[localIdentityKey[i]];

                        if (!isNull(array) && array.length > 0) {

                            let fieldValueArray = [];
                            let fieldValue_descriptionArray = [];

                            for (var j = 0; j < array.length; j++) {
                                var item = array[j];
                                fieldValueArray[j] = String(item.fieldValue);
                                fieldValue_descriptionArray[j] = item.fieldValue_description;
                            }

                            var localIdentityAttribute = localIdentity[localIdentityKey[i]];

                            localIdentityAttribute.data = fieldValue_descriptionArray;
                            localIdentityAttribute.setData = fieldValueArray;

                        }
                    }

                }


            }


            console.log(dajindai)

        }
    });





    let up1 = $('#up1');
    let up2 = $('#up2');
    let up3 = $('#up3');

    let Request = new searchUrl(); //地址参数化。方法来自base.js
    let urlType = Request.form;
    let channel = Request.channel;

    //up1
    let chooseCity_ = $('#chooseCity');
    let loansAmount_ = $('.loansMoneyInput');
    let loansAmounttime_ = $('.AmounttimeInput');
    let loanUse_ = $('.loanUseInput');
    let identity_ = $('#identity');
    let visa_ = $('#visa');
    let wld_ = $('#wld');

    //up2

    let userchoosecityname = '';
    let userchoosecitycode = '';
    let autoCity = '';
    let autocode = '';
    let titletxt = '';
    let office_ = $('#office');
    let office_workType = $('#office_workType');
    let company_name = $('#company_name');
    let monthly_income = $('#monthly_income');
    let office_payType = $('#office_payType');
    let office_time = $('#office_time');

    let individual_ = $('#individual');
    let individual_income = $('#individual_income');
    let individual_time = $('#individual_time');
    let individual_licence = $('#individual_licence');
    let individual_pos = $('#individual_pos');
    let individual_pos_income = $('#individual_pos_income');
    let individual_pos_incomeOFF = false;


    let ec_ = $('#ec');
    let ec_platform = $('#ec_platform');
    let ec_income = $('#ec_income');
    let ec_time = $('#ec_time');
    let ec_licence = $('#ec_licence');


    let freelance_income = $('#freelance_income');
    let freelance_ = $('#freelance');


    let company_Type = $('#company_Type');
    let company_ = $('#company');
    let company_public_income = $('#company_public_income');
    let company_individual_income = $('#company_individual_income');
    let company_time = $('#company_time');
    let company_licence = $('#company_licence');

    let localsocialsecurity = $('#localsocialsecurity');
    let providentfund = $('#providentfund');

    //up3


    let username_ = $('#djd_username');
    let userid_ = $('#djd_userid');

    let car = $('#car');
    let carappraisement = $('#carappraisement');
    let house = $('#house');
    let houseType = $('#houseType');
    let houseTime = $('#houseTime');
    let houseValue = $('#houseValue');
    let insurance = $('#insurance');
    let insuranceCompany = $('#insuranceCompany');
    let insurancevalue = $('#insurancevalue');
    let facilityTime = $('#facilityTime');
    let setSendData = {};


    //贷款金额

    for (let i = 0; i < dajindai.loansAmount.data.length; i++) {

        $('.loansMoney').append('<span data-value="' + dajindai.loansAmount.setData[i] + '">' + dajindai.loansAmount.data[i] + '</span>');
        $('#loansAmountItem').append('<span data-value="' + dajindai.loansAmount.setData[i] + '">' + dajindai.loansAmount.data[i] + '</span>');
    }

    //贷款期限

    for (let i = 0; i < dajindai.loansAmounttime.data.length; i++) {

        $('#loansAmountTimeItem').append('<span data-value="' + dajindai.loansAmounttime.setData[i] + '">' + dajindai.loansAmounttime.data[i] + '</span>');
        $('.loansAmounttime').append('<span data-value="' + dajindai.loansAmounttime.setData[i] + '">' + dajindai.loansAmounttime.data[i] + '</span>');


    }

    //贷款用途

    for (let i = 0; i < dajindai.loanUse.data.length; i++) {

        $('#loanUseItem').append('<span data-value="' + dajindai.loanUse.setData[i] + '">' + dajindai.loanUse.data[i] + '</span>');
        $('.loanUse').append('<span data-value="' + dajindai.loanUse.setData[i] + '">' + dajindai.loanUse.data[i] + '</span>');
    }

    //信用卡额度

    for (let i = 0; i < dajindai.visa.data.length; i++) {

        $('#visaItem').append('<span data-value="' + dajindai.visa.setData[i] + '">' + dajindai.visa.data[i] + '</span>');
    }

    //是否有微粒贷额度

    for (let i = 0; i < dajindai.wld.data.length; i++) {

        $('#wldItem').append('<span data-value="' + dajindai.wld.setData[i] + '">' + dajindai.wld.data[i] + '</span>');
    }


    //职业身份

    for (let i = 0; i < dajindai.identity.all.length; i++) {

        $('#identityItem').append('<span data-value="' + dajindai.identity.setData[i] + '">' + dajindai.identity.all[i] + '</span>');

    }


    //上班族
    //单位类型

    for (let i = 0; i < dajindai.identity.office.office_workType.data.length; i++) {

        $('#office_workTypeItem').append('<span data-value="' + dajindai.identity.office.office_workType.setData[i] + '">' + dajindai.identity.office.office_workType.data[i] + '</span>');

    }


    //月收入(元

    for (let i = 0; i < dajindai.identity.office.sb_income.data.length; i++) {

        $('#monthly_incomeItem').append('<span data-value="' + dajindai.identity.office.sb_income.setData[i] + '">' + dajindai.identity.office.sb_income.data[i] + '</span>');

    }


    //工资发放形式

    for (let i = 0; i < dajindai.identity.office.office_payType.data.length; i++) {

        $('#office_payTypeItem').append('<span data-value="' + dajindai.identity.office.office_payType.setData[i] + '">' + dajindai.identity.office.office_payType.data[i] + '</span>');

    }


    //当前单位工龄

    for (let i = 0; i < dajindai.identity.office.office_time.data.length; i++) {

        $('#office_timeItem').append('<span data-value="' + dajindai.identity.office.office_time.setData[i] + '">' + dajindai.identity.office.office_time.data[i] + '</span>');

    }


    //个体

    //月经营收入(元)

    for (let i = 0; i < dajindai.identity.individual.gt_income.data.length; i++) {

        $('#individual_incomeItem').append('<span data-value="' + dajindai.identity.individual.gt_income.setData[i] + '">' + dajindai.identity.individual.gt_income.data[i] + '</span>');

    }


    //经营年限

    for (let i = 0; i < dajindai.identity.individual.time.data.length; i++) {

        $('#individual_timeItem').append('<span data-value="' + dajindai.identity.individual.time.setData[i] + '">' + dajindai.identity.individual.time.data[i] + '</span>');

    }


    //是否有经营执照

    for (let i = 0; i < dajindai.identity.individual.licence.data.length; i++) {

        $('#individual_licenceItem').append('<span data-value="' + dajindai.identity.individual.licence.setData[i] + '">' + dajindai.identity.individual.licence.data[i] + '</span>');

    }


    // //是否使用pos机
    //
    // for (let i = 0; i < dajindai.identity.individual.pos.data.length; i++) {
    //
    //     $('#individual_posItem').append('<span data-value="' + dajindai.identity.individual.pos.setData[i] + '">' + dajindai.identity.individual.pos.data[i] + '</span>');
    //
    // }
    //
    //
    // //pos机累计流水
    //
    // for (let i = 0; i < dajindai.identity.individual.gt_pos_income.data.length; i++) {
    //
    //     $('#individual_pos_incomeItem').append('<span data-value="' + dajindai.identity.individual.gt_pos_income.setData[i] + '">' + dajindai.identity.individual.gt_pos_income.data[i] + '</span>');
    //
    // }

    //电商主


    //电商平台

    for (let i = 0; i < dajindai.identity.ec.platform.data.length; i++) {

        $('#ec_platformItem').append('<span data-value="' + dajindai.identity.ec.platform.setData[i] + '">' + dajindai.identity.ec.platform.data[i] + '</span>');

    }

    //月流水(元)

    for (let i = 0; i < dajindai.identity.ec.ds_income.data.length; i++) {

        $('#ec_incomeItem').append('<span data-value="' + dajindai.identity.ec.ds_income.setData[i] + '">' + dajindai.identity.ec.ds_income.data[i] + '</span>');

    }

    //经营年限

    for (let i = 0; i < dajindai.identity.ec.time.data.length; i++) {

        $('#ec_timeItem').append('<span data-value="' + dajindai.identity.ec.time.setData[i] + '">' + dajindai.identity.ec.time.data[i] + '</span>');

    }

    //是否有经营执照

    for (let i = 0; i < dajindai.identity.ec.licence.data.length; i++) {

        $('#ec_licenceItem').append('<span data-value="' + dajindai.identity.ec.licence.setData[i] + '">' + dajindai.identity.ec.licence.data[i] + '</span>');

    }


    //自由职业

    //月收入(元)

    for (let i = 0; i < dajindai.identity.freelance.zy_income.data.length; i++) {

        $('#freelance_incomeItem').append('<span data-value="' + dajindai.identity.freelance.zy_income.setData[i] + '">' + dajindai.identity.freelance.zy_income.data[i] + '</span>');

    }

    //企业主


    //公司类型
    for (let i = 0; i < dajindai.identity.company.companyType.data.length; i++) {

        $('#company_TypeItem').append('<span data-value="' + dajindai.identity.company.companyType.setData[i] + '">' + dajindai.identity.company.companyType.data[i] + '</span>');

    }


    //月对公流水(元)
    for (let i = 0; i < dajindai.identity.company.qy_income_public.data.length; i++) {

        $('#company_public_incomeItem').append('<span data-value="' + dajindai.identity.company.qy_income_public.setData[i] + '">' + dajindai.identity.company.qy_income_public.data[i] + '</span>');

    }


    // //月对私流水(元)
    // for (let i = 0; i < dajindai.identity.company.qy_income_private.data.length; i++) {
    //
    //     $('#company_individual_incomeItem').append('<span data-value="' + dajindai.identity.company.qy_income_private.setData[i] + '">' + dajindai.identity.company.qy_income_private.data[i] + '</span>');
    //
    // }


    //经营年限
    for (let i = 0; i < dajindai.identity.company.time.data.length; i++) {

        $('#company_timeItem').append('<span data-value="' + dajindai.identity.company.time.setData[i] + '">' + dajindai.identity.company.time.data[i] + '</span>');

    }


    //是否有营业执照
    for (let i = 0; i < dajindai.identity.company.licence.data.length; i++) {

        $('#company_licenceItem').append('<span data-value="' + dajindai.identity.company.licence.setData[i] + '">' + dajindai.identity.company.licence.data[i] + '</span>');

    }


    //是否有本地公积金
    for (let i = 0; i < dajindai.providentfund.data.length; i++) {

        $('#providentfundItem').append('<span data-value="' + dajindai.providentfund.setData[i] + '">' + dajindai.providentfund.data[i] + '</span>');

    }

    //是否有本地社保
    for (let i = 0; i < dajindai.localsocialsecurity.data.length; i++) {

        $('#localsocialsecurityItem').append('<span data-value="' + dajindai.localsocialsecurity.setData[i] + '">' + dajindai.localsocialsecurity.data[i] + '</span>');

    }


//up3

    //名下是否有车产
    for (let i = 0; i < dajindai.car.data.length; i++) {

        $('#carItem').append('<span data-value="' + dajindai.car.setData[i] + '">' + dajindai.car.data[i] + '</span>');

    }

    //车产估值
    for (let i = 0; i < dajindai.carappraisement.data.length; i++) {

        $('#carappraisementItem').append('<span data-value="' + dajindai.carappraisement.setData[i] + '">' + dajindai.carappraisement.data[i] + '</span>');

    }


    //名下是否有房产
    for (let i = 0; i < dajindai.house.data.length; i++) {

        $('#houseItem').append('<span data-value="' + dajindai.house.setData[i] + '">' + dajindai.house.data[i] + '</span>');

    }


    //房产类型
    for (let i = 0; i < dajindai.houseType.data.length; i++) {

        $('#houseTypeItem').append('<span data-value="' + dajindai.houseType.setData[i] + '">' + dajindai.houseType.data[i] + '</span>');

    }

    //
    // //房龄
    // for (let i = 0; i < dajindai.houseTime.data.length; i++) {
    //
    //     $('#houseTimeItem').append('<span data-value="' + dajindai.houseTime.setData[i] + '">' + dajindai.houseTime.data[i] + '</span>');
    //
    // }


    //房产估值
    for (let i = 0; i < dajindai.houseValue.data.length; i++) {

        $('#houseValueItem').append('<span data-value="' + dajindai.houseValue.setData[i] + '">' + dajindai.houseValue.data[i] + '</span>');

    }


    //人寿保险
    for (let i = 0; i < dajindai.insurance.data.length; i++) {

        $('#insuranceItem').append('<span data-value="' + dajindai.insurance.setData[i] + '">' + dajindai.insurance.data[i] + '</span>');

    }

    //
    // //投保公司
    // for (let i = 0; i < dajindai.insuranceCompany.data.length; i++) {
    //
    //     $('#insuranceCompanyItem').append('<span data-value="' + dajindai.insuranceCompany.setData[i] + '">' + dajindai.insuranceCompany.data[i] + '</span>');
    //
    // }


    //保单价值(元)
    for (let i = 0; i < dajindai.insurance_value.data.length; i++) {

        $('#insurancevalueItem').append('<span data-value="' + dajindai.insurance_value.setData[i] + '">' + dajindai.insurance_value.data[i] + '</span>');

    }


    //方便联系时间
    for (let i = 0; i < dajindai.connectionTime.length; i++) {

        $('#facilityTimeItem').append('<span data-value="' + dajindai.connectionTime[i] + '">' + dajindai.connectionTime[i] + '</span>');

    }


    //分割线——————————————————————————————————————————————————————————————————————————————————————

    //首页banner区域的大金贷申请
    //选择贷款金额


    loansAmount_.click(
        function () {
            $(this).addClass('loansInput');
            $('.loansMoney').slideDown();

        });

    $('.loansMoney').on('click', 'span', function () {

        let this_ = $(this);
        let chooseSpanHtml = this_.html();
        let chooseSpanVlaue = this_.data('value');

        loansAmount_.val(chooseSpanHtml).data('value', chooseSpanVlaue);

        this_.parent().slideUp();


    });

    //选择贷款期限

    loansAmounttime_.click(
        function () {
            $(this).addClass('loansInput');
            $('.loansAmounttime').slideDown();

        });

    $('.loansAmounttime').on('click', 'span', function () {

        let this_ = $(this);
        let chooseSpanHtml = this_.html();
        let chooseSpanVlaue = this_.data('value');

        loansAmounttime_.val(chooseSpanHtml).data('value', chooseSpanVlaue);

        this_.parent().slideUp();


    });


    //选择贷款用途

    loanUse_.click(
        function () {
            $(this).addClass('loansInput');
            $('.loanUse').slideDown();

        });

    $('.loanUse').on('click', 'span', function () {

        let this_ = $(this);
        let chooseSpanHtml = this_.html();
        let chooseSpanVlaue = this_.data('value');

        loanUse_.val(chooseSpanHtml).data('value', chooseSpanVlaue);

        this_.parent().slideUp();


    });


    //呼出大金袋城市选择
    $('.dajindaiCityInput').click(function () {

        $('.chooseCityBox').show();
        sessionStorage.setItem('indexChooseCity', 'djd');

    });

    function getdjdUserinfo(phoneNumber,identifyCode,userId) {


        djd({
            url:largeCredit+'getLargeCreditLast',
            type:"post",
            dataType: 'json',
            data:{
                mobile:phoneNumber,
                identifyCode:identifyCode,
                userId:userId
            },
            mySuccess:function (data) {
                if(isResponseSuccess('success',data)){


                    setSessionObj('djdUserInfo',data.data.largeCredit);

                    //  返回上一次用户的数据

                    ///处理上次用户申请的数据渲染
                    setTimeout(function () {

                        var backData=getSessionObj('djdUserInfo');
                        console.log(backData);


                        if(notNull(backData.profession)){


                            identity_.data('value', backData.profession).html(backData.profession_description).css('color','#4a4a4a');



                        }


                        switch (backData.profession) {

                            case 1:

                                individual_.hide("fast");
                                ec_.hide("fast");
                                freelance_.hide("fast");
                                company_.hide("fast");
                                office_.fadeIn();

                                break;
                            case 2:
                                office_.hide("fast");
                                individual_.fadeIn();
                                ec_.hide("fast");
                                freelance_.hide("fast");
                                company_.hide("fast");
                                break;
                            case 3:
                                office_.hide("fast");
                                individual_.hide("fast");
                                freelance_.hide("fast");
                                company_.hide("fast");

                                ec_.fadeIn("fast");

                                break;
                            case 4:
                                office_.hide("fast");
                                individual_.hide("fast");
                                ec_.hide("fast");
                                company_.hide("fast");

                                freelance_.fadeIn("fast");

                                break;
                            case 5:
                                office_.hide();
                                individual_.hide();
                                ec_.hide();
                                freelance_.hide();

                                company_.fadeIn();
                                break;
                            default:

                                office_.hide();
                                individual_.hide();
                                ec_.hide();
                                freelance_.hide();
                                company_.hide();
                                defaultHint('请选择职业身份');

                        }




                        if(notNull(backData.credit_card_money)){



                            visa_.data('value', backData.credit_card_money).html(backData.credit_card_money_description).css('color','#4a4a4a');



                        }
                        if(notNull(backData.wld_money)){

                            wld_.data('value', backData.wld_money).html(backData.wld_money_description).css('color','#4a4a4a');


                        }
                        if(notNull(backData.sb_security)){
                            localsocialsecurity.data('value', backData.sb_security).html(backData.sb_security_description).css('color','#4a4a4a');
                        }

                        if(notNull(backData.sb_fund)){
                            providentfund.data('value', backData.sb_fund).html(backData.sb_fund_description).css('color','#4a4a4a');
                        }

                        if(notNull(backData.name)){
                            username_.data('value', backData.name).val(backData.name).css('color','#4a4a4a');
                        }
                        if(notNull(backData.id_card)){
                            userid_.data('value', backData.id_card).val(backData.id_card).css('color','#4a4a4a');
                        }

                        <!--上班族-->

                        if(notNull(backData.sb_company_type)){
                            office_workType.data('value', backData.sb_company_type).html(backData.sb_company_type_description).css('color','#4a4a4a');
                        }

                        if(notNull(backData.sb_income)){
                            monthly_income.data('value', backData.sb_income).html(backData.sb_income_description).css('color','#4a4a4a');
                        }
                        if(notNull(backData.sb_pay_type)){
                            office_payType.data('value', backData.sb_pay_type).html(backData.sb_pay_type_description).css('color','#4a4a4a');
                        }


                        <!--个体-->

                        if(notNull(backData.gt_income)){
                            individual_income.data('value', backData.gt_income).html(backData.gt_income_description).css('color','#4a4a4a');
                        }  if(notNull(backData.gt_company_age)){
                            individual_time.data('value', backData.gt_company_age).html(backData.gt_company_age_description).css('color','#4a4a4a');
                        }  if(notNull(backData.gt_license)){
                            individual_licence.data('value', backData.gt_license).html(backData.gt_license_description).css('color','#4a4a4a');
                        }

                        <!--电商主-->

                        if(notNull(backData.ds_platform)){
                            ec_platform.data('value', backData.ds_platform).html(backData.ds_platform_description).css('color','#4a4a4a');
                        }  if(notNull(backData.ds_income)){
                            ec_income.data('value', backData.ds_income).html(backData.ds_income_description).css('color','#4a4a4a');
                        }  if(notNull(backData.ds_company_age)){
                            ec_time.data('value', backData.ds_company_age).html(backData.ds_company_age_description).css('color','#4a4a4a');
                        }  if(notNull(backData.ds_license)){
                            ec_licence.data('value', backData.ds_license).html(backData.ds_license_description).css('color','#4a4a4a');
                        }
                        <!--自由职业-->
                        if(notNull(backData.zy_income)){
                            freelance_income.data('value', backData.zy_income).html(backData.zy_income_description).css('color','#4a4a4a');
                        }

                        <!--企业主-->

                        if(notNull(backData.qy_company_type)){
                            company_Type.data('value', backData.qy_company_type).html(backData.qy_company_type_description).css('color','#4a4a4a');
                        }    if(notNull(backData.qy_income_public)){
                            company_public_income.data('value', backData.qy_income_public).html(backData.qy_income_public_description).css('color','#4a4a4a');
                        }      if(notNull(backData.qy_company_age)){
                            company_time.data('value', backData.qy_company_age).html(backData.qy_company_age_description).css('color','#4a4a4a');
                        }    if(notNull(backData.qy_license)){
                            company_licence.data('value', backData.qy_license).html(backData.qy_license_description).css('color','#4a4a4a');
                        }

                        //UP3


                        if(notNull(backData.car)){
                            car.data('value', backData.car).html(backData.car_description).css('color','#4a4a4a');

                            if(backData.car=='0'){
                                $('.aboutCar').hide();

                            }else {
                                $('.aboutCar').show();

                            }

                        }

                        if(notNull(backData.car_value)){
                            carappraisement.data('value', backData.car_value).html(backData.car_value_description).css('color','#4a4a4a');
                        }
                        if(notNull(backData.house)){
                            house.data('value', backData.house).html(backData.house_description).css('color','#4a4a4a');

                            if(backData.house=='0'){
                                $('.aboutHouse').hide();

                            }else {
                                $('.aboutHouse').show();

                            }
                        }
                        if(notNull(backData.house_type)){
                            houseType.data('value', backData.house_type).html(backData.house_type_description).css('color','#4a4a4a');
                        }

                        if(notNull(backData.house_value)){
                            houseValue.data('value', backData.house_value).html(backData.house_value_description).css('color','#4a4a4a');
                        }

                        console.log('zy_insurance'+backData.zy_insurance);
                        console.log('zy_insurance'+notNull(backData.zy_insurance));
                        console.log('car'+notNull(backData.car));
                        console.log('house'+notNull(backData.house));


                        if(notNull(backData.zy_insurance)){

                            insurance.data('value', backData.zy_insurance).html(backData.zy_insurance_description).css('color','#4a4a4a');

                            if(backData.zy_insurance=='0'){
                                $('.aboutInsurance').hide();

                            }else {
                                $('.aboutInsurance').show();

                            }


                        }
                        if(notNull(backData.zy_insurance_value)){
                            insurancevalue.data('value', backData.zy_insurance_value).html(backData.zy_insurance_value_description).css('color','#4a4a4a');
                        }



                        if(notNull(backData.contactTime)){
                            facilityTime.data('value', backData.contactTime).html(backData.contactTime).css('color','#4a4a4a');
                        }




                    },50);












    }else{

                    if(notNull(isResponseSuccess('msg',data))){
                        defaultHint(isResponseSuccess('msg',data));
                    }else {
                        defaultHint('网络错误，请刷新！')
                    }
                }
            }
        })


    }



    $('#bannerdjd').click(function () {


        let userinfodjd = getUserInfo();

        let isloginType = islogin();

        if (isloginType) {


            var
                stormData_chooseCity_ = $('.dajindaiCityInput').val(),

                stormData_autoLocation = sessionStorage.getItem('autoLocation'),
                stormData_autoLocationCode = sessionStorage.getItem('autoLocationCode'),

                stormData_djdCityCode = sessionStorage.getItem('djdCityCode'),
                stormData_djdCityName = sessionStorage.getItem('djdCityName'),

                stormData_loansAmount_ = loansAmount_.data('value'),
                stormData_loansAmounttime_ = loansAmounttime_.data('value'),

                stormData_loanUse_ = loanUse_.data('value'),

                showMassage = '';


            if (isNull(stormData_chooseCity_)) {
                defaultHint('请选择贷款城市');
                return
            }

            if (isNull(stormData_loansAmount_)) {
                defaultHint('请选择贷款金额');
                return
            }

            if (isNull(stormData_loansAmounttime_)) {
                defaultHint('请选择贷款期限');
                return
            }

            if (isNull(stormData_loanUse_)) {
                defaultHint('请选择贷款用途');
                return
            }


            //位置
            if (notNull(stormData_djdCityCode)) {
                setSendData.work_city = stormData_djdCityCode;
                setSendData.work_city_name = stormData_djdCityName;
            } else {
                setSendData.work_city = stormData_autoLocationCode;
                setSendData.work_city_name = stormData_autoLocation;
            }

            //贷款金额
            setSendData.money = stormData_loansAmount_;

            //贷款期限
            setSendData.limit = stormData_loansAmounttime_;

            //贷款用途
            setSendData.purpose = stormData_loanUse_;

            //步骤

            /**
             * 步骤(信息完成度).
             * one,two,three
             */

            setSendData.step = 'one';

            setSendData.channel = 'jiedaijiapc';


            // sendFN(setSendData)


            setSendData.mobile = userinfodjd.phone;

            setSessionObj('userSendDataUp1', setSendData);


            let sendData = {};

            let identifyCode = sessionStorage.getItem('identifyCode');

            let phoneLoginState = userinfodjd.id;

            getdjdUserinfo(userinfodjd.phone,identifyCode,phoneLoginState);


            if(notNull(phoneLoginState)){
                sendData={largeCredit:setSendData,channel:setSendData.channel,mobile:setSendData.mobile,userId:phoneLoginState}
            }else {
                sendData={largeCredit:setSendData,channel:setSendData.channel,mobile:setSendData.mobile,identifyCode:identifyCode}
            }

            myAjaxFuncJsonNotchangeToken({
                url: largeCredit + 'applyLargeCreditTemp',
                type: "post",
                dataType: 'json',
                data: sendData,
                mySuccess: function (data) {

                    if (isResponseSuccess('success', data)) {

                        $('#dajindai').show();
                        $('#sectiondjd').show();


                    } else {
                        if (notNull(isResponseSuccess('msg', data))) {
                            defaultHint(isResponseSuccess('msg', data));
                        } else {
                            defaultHint('网络错误，请刷新！')
                        }
                    }

                }
            })


        } else {
            $('#loginMode').show()
        }
    });





    //分割线——————————————————————————————————————————————————————————————————————————————————————


    //关闭
    $('#closeDajindai').click(function () {

        $('#dajindai').hide();
        $('#djdcomplete').hide();

    });

    //关闭
    $('#closeDajindai2').click(function () {

        $('#djdcomplete').hide();
        $('#dajindai').hide();

    });

    //大金贷选择选项

    $('.section_bottom').on('click', 'i', function () {

        let this_ = $(this);

        if (isNull(this_.data('city'))) {

            $('.baseBox').find('div').hide();
            $('.baseBox').find('i').removeClass('clickInput');
            this_.addClass('clickInput');
            this_.next().show();

        }

    }).on('click', '.chooseItem span', function () {

        let this_ = $(this);
        let chooseSpanHtml = this_.html();
        let chooseSpanVlaue = this_.data('value');

        this_.parent().prev().data('value', chooseSpanVlaue);
        this_.parent().prev().html(chooseSpanHtml);
        this_.parent().hide();
        this_.parent().prev().removeClass('clickInput').css({"color": "#4a4a4a"});


    });

    $('#identityItem').on('click','span',function () {

        let this_ = $(this);
        let chooseSpanHtml = this_.html();
        let chooseSpanVlaue = this_.data('value');

        switch (chooseSpanVlaue) {

            case 1:

                individual_.hide("fast");
                ec_.hide("fast");
                freelance_.hide("fast");
                company_.hide("fast");
                office_.fadeIn();

                break;
            case 2:
                office_.hide("fast");
                individual_.fadeIn();
                ec_.hide("fast");
                freelance_.hide("fast");
                company_.hide("fast");
                break;
            case 3:
                office_.hide("fast");
                individual_.hide("fast");
                freelance_.hide("fast");
                company_.hide("fast");

                ec_.fadeIn("fast");

                break;
            case 4:
                office_.hide("fast");
                individual_.hide("fast");
                ec_.hide("fast");
                company_.hide("fast");

                freelance_.fadeIn("fast");

                break;
            case 5:
                office_.hide();
                individual_.hide();
                ec_.hide();
                freelance_.hide();

                company_.fadeIn();
                break;
            default:

                defaultHint('获取职业信息失败，请重新选择职业信息');
        }


    });


    //


    $('#insuranceItem').on('click', 'span', function () {
        var val = $(this).data('value');


        if (val == '0') {
            $('.aboutInsurance').hide();

        } else {
            $('.aboutInsurance').show();

        }


    });
    $('#carItem').on('click', 'span', function () {
        var val = $(this).data('value');

        if (val == '0') {
            $('.aboutCar').hide();

        } else {
            $('.aboutCar').show();

        }

    });
    $('#houseItem').on('click', 'span', function () {
        var val = $(this).data('value');


        if (val == '0') {
            $('.aboutHouse').hide();

        } else {
            $('.aboutHouse').show();

        }

    });
    $('#individual_pos').on('click', 'span', function () {
        var val = $(this).data('value');


        if (val == '0') {
            $('.individual_pos_income_show').hide();

        } else {
            $('.individual_pos_income_show').show();

        }

    });
    function checkname (val) {

        var reg = /^[\u4E00-\u9FA5]{2,15}$/;

        if (!reg.test(val)) {

            return false

        } else {

            return true

        }

    }




    //第一段审核

    $('#up1_btnNext').click(function () {

        $('#up_3Send').removeAttr( 'disabled',"disabled");
        $('#up_3Send').html('提交');


        let

            stormData_usename_ = username_.val(),
            stormData_userid_ = userid_.val(),

            userID = checkId(stormData_userid_),
            userNameC = checkname(stormData_usename_),

            stormData_identity_ = identity_.data('value'),

            showMassage = '',
            stormData_localsocialsecurity = localsocialsecurity.data('value'),
            stormData_providentfund = providentfund.data('value');


            if(!userNameC){
              defaultHint('请填写正确真实姓名，2-15中文字符');
              return;
          }

           if(!userID){
               defaultHint('请填写正确身份证号码');
               return;
          }

        if(isNull(stormData_localsocialsecurity)){
            defaultHint('请选择是否有本地社保');
            return;
        }
        if(isNull(stormData_providentfund)){
            defaultHint('请选择是否有本地公积金');
            return;
        }



        if(isNull(stormData_identity_)){
            defaultHint('请选择职业身份');
            return;
        }


        let  setSendData=getSessionObj('userSendDataUp1');

        //公积金
        setSendData.sb_fund=stormData_providentfund;

        //  社保
        setSendData.sb_security=stormData_localsocialsecurity;


        //姓名
        setSendData.name = stormData_usename_;

        // 身份证
        setSendData.id_card = stormData_userid_;
        setSendData.profession = stormData_identity_;



        switch (stormData_identity_) {

            case 1:

                console.log(stormData_identity_);

                let
                    stormData_office_workType = office_workType.data('value'),
                    stormData_monthly_income = monthly_income.data('value'),
                    stormData_office_payType = office_payType.data('value');


                if(isNull(stormData_office_workType)){

                    defaultHint('请选择单位类型');
                    return
                }



                if(isNull(stormData_monthly_income)){

                    defaultHint('请选择月收入范围');
                    return
                }



                if(isNull(stormData_office_payType)){

                    defaultHint('请选择工资发放形式');
                    return
                }

                                    setSendData.sb_company_type = stormData_office_workType;
                                    setSendData.sb_income = stormData_monthly_income;
                                    setSendData.sb_pay_type = stormData_office_payType;

                                    setSessionObj('userSendDataUp2', setSendData);

                                    setTimeout(function () {
                                        gotoNext()

                                    }, 300)


                break;
            case 2:
                console.log(stormData_identity_);


                let
                    stormData_individual_income = individual_income.data('value'),
                    stormData_individual_time = individual_time.data('value'),
                    stormData_individual_licence = individual_licence.data('value');




                if(isNull(stormData_individual_income)){

                    defaultHint('请选择月经营收入');
                    return
                }



                if(isNull(stormData_individual_time)){

                    defaultHint('请选择经营年限');
                    return
                }



                if(isNull(stormData_individual_licence)){

                    defaultHint('请选择是否有经营执照');
                    return
                }


                                setSendData.gt_company_city = setSendData.work_city;
                                setSendData.gt_company_city_name = setSendData.work_city_name;

                                setSendData.gt_income = stormData_individual_income;
                                setSendData.gt_company_age = stormData_individual_time;
                                setSendData.gt_license = stormData_individual_licence;

                                    setSessionObj('userSendDataUp2', setSendData);

                                    //console.log(setSendData.gt_income)

                                    setTimeout(function () {
                                        gotoNext()

                                    }, 300);


                break;
            case 3:
                console.log(stormData_identity_);

                let
                    stormData_ec_platform = ec_platform.data('value'),
                    stormData_ec_income = ec_income.data('value'),
                    stormData_ec_time = ec_time.data('value'),
                    stormData_ec_licence = ec_licence.data('value');



                if(isNull(stormData_ec_platform)){

                    defaultHint('请选择电商平台');
                    return
                }

                if(isNull(stormData_ec_income)){

                    defaultHint('请选择月经营收入范围');
                    return
                }

                if(isNull(stormData_ec_time)){

                    defaultHint('请选择经营年限');
                    return
                }

                if(isNull(stormData_ec_licence)){

                    defaultHint('请选择是否有经营执照');
                    return
                }



                                setSendData.ds_platform = stormData_ec_platform;
                                setSendData.ds_income = stormData_ec_income;
                                setSendData.ds_company_age = stormData_ec_time;
                                setSendData.ds_license = stormData_ec_licence;


                                setSessionObj('userSendDataUp2', setSendData);

                                setTimeout(function () {
                                    gotoNext()
                                }, 300)


                break;
            case 4:
                console.log(stormData_identity_);

                let
                    stormData_freelance_income = freelance_income.data('value');


                if(isNull(stormData_freelance_income)){

                    defaultHint('请选择月收入');
                    return
                }


                    setSendData.zy_income = stormData_freelance_income;

                    setSessionObj('userSendDataUp2', setSendData);

                    setTimeout(function () {
                        gotoNext()

                    }, 300)


                break;
            case 5:
                console.log(stormData_identity_);


                let
                    stormData_company_Type = company_Type.data('value'),
                    stormData_company_public_income = company_public_income.data('value'),
                    stormData_company_time = company_time.data('value'),
                    stormData_company_licence = company_licence.data('value');


                if(isNull(stormData_company_Type)){

                    defaultHint('请选择公司类型');
                    return
                }

                if(isNull(stormData_company_public_income)){

                    defaultHint('请选择月流水');
                    return
                }

                if(isNull(stormData_company_time)){

                    defaultHint('请选择经营年限');
                    return
                }
                if(isNull(stormData_company_licence)){

                    defaultHint('请选择是否有经营执照');
                    return
                }

                                    setSendData.qy_company_city = setSendData.work_city;
                                    setSendData.qy_company_city_name = setSendData.work_city_name;

                                    setSendData.qy_company_type = stormData_company_Type;
                                    setSendData.qy_income_public = stormData_company_public_income;

                                    setSendData.qy_company_age = stormData_company_time;
                                    setSendData.qy_license = stormData_company_licence;

                                    //console.log(setSendData.qy_income_public);
                                    // console.log(setSendData.qy_income_private);
                                    setSessionObj('userSendDataUp2', setSendData);

                                    setTimeout(function () {

                                        gotoNext()

                                    }, 300);

                break;

            default:

        }


        function gotoNext() {

            setSendData.step = 'two';


            let sendData={};

            let identifyCode=sessionStorage.getItem('identifyCode');

            let userinfodjd = getUserInfo();
            let phoneLoginState = userinfodjd.id;


            setSendData.mobile = userinfodjd.phone;


            if(notNull(phoneLoginState)){
                sendData={largeCredit:setSendData,channel:setSendData.channel,mobile:setSendData.mobile,userId:phoneLoginState}
            }else {
                sendData={largeCredit:setSendData,channel:setSendData.channel,identifyCode:identifyCode,mobile:setSendData.mobile}
            }

            myAjaxFuncJsonNotchangeToken({
                url:largeCredit+'applyLargeCreditTemp',
                type:"post",
                dataType: 'json',
                data:sendData,
                mySuccess:function (data) {
                    if(isResponseSuccess('success',data)){

                        up1.hide();
                        up3.fadeIn();
                        $('.pionInfo').hide();
                        $('.pionInfo2').show();


                    }else{

                        if(notNull(isResponseSuccess('msg',data))){
                            defaultHint(isResponseSuccess('msg',data));
                        }else {
                            defaultHint('网络错误，请刷新！')
                        }


                    }

                }
            })




        }



    });



    $('#up_3before').click(function () {

        up3.hide();

        up1.fadeIn();



        $('.pionInfo').show();
        $('.pionInfo2').hide();

    });



    $('#up_3Send').click(function () {

        var this_ = $(this);


        let

            stormData_car = car.data('value'),
            stormData_carappraisement = carappraisement.data('value'),
            stormData_house = house.data('value'),
            stormData_houseType = houseType.data('value'),
            stormData_houseTime = houseTime.data('value'),
            stormData_houseValue = houseValue.data('value'),
            stormData_insurance = insurance.data('value'),
            stormData_insuranceCompany = insuranceCompany.data('value'),
            stormData_insurancevalue = insurancevalue.data('value'),
            stormData_visa=visa_.data('value'),
            stormData_wld=wld_.data('value'),
            stormData_facilityTime = facilityTime.data('value'),

            setSendData = getSessionObj('userSendDataUp2'),

            showMassage = '';

        if (notNull(stormData_facilityTime)) {
            setSendData.contactTime = stormData_facilityTime;


            if(!notNull(stormData_visa)){
                defaultHint('请选择信用卡额度');
                return
            }
            if(!notNull(stormData_wld)){
                defaultHint('选择是否有微粒贷额度');
                return

            }

            //信用卡额度

            if (stormData_visa == '0') {
                setSendData.credit_card = '0';
            }else {
                setSendData.credit_card = '1';
                setSendData.credit_card_money=stormData_visa;
            }

            //有微粒贷

            setSendData.wld_money=stormData_wld;

            setSendData.step='three';


            if (aboutCar()) {
                if (aboutHouse()) {
                    if (aboutInsurance()) {
                        //关于保险
                        if ($('#userCheckbox').is(':checked')) {
                            setSendData.infoUseIdentify = true

                        } else {
                            setSendData.infoUseIdentify = false
                        }

                        setSendData.platform = navigator.userAgent;

                        sendFN(setSendData);


                        console.log(setSendData)

                        this_.attr('disabled', "disabled");
                        this_.css('background', '#ccc');
                        defaultHint('提交中...');


                    }
                }
            }


        } else {
            showMassage = '请选择方便联系时间';
            defaultHint(showMassage);
        }


        function aboutHouse() {
            var return_ = '';
            if (notNull(stormData_house)) {

                setSendData.house = stormData_house;

                if (stormData_house != '0') {

                    if (notNull(stormData_houseType)) {
                        setSendData.house_type = stormData_houseType;

                    } else {
                        showMassage = '请选择房产类型';
                        defaultHint(showMassage);
                        return false
                    }

                    if (notNull(stormData_houseValue)) {
                        setSendData.house_value = stormData_houseValue;

                    } else {
                        showMassage = '请选择房产估值';
                        defaultHint(showMassage);
                        return false
                    }

                    if (stormData_house == '1') {
                        setSendData.house_mortgage = 1;
                    }
                    if (stormData_house == '2') {
                        setSendData.house_mortgage = 0;
                    }

                } else {
                    setSendData.house = 0;
                }
                return true

            } else {
                showMassage = '请选择名下是否有房产';
                defaultHint(showMassage);
                return false
            }


        }


        function aboutCar() {
            if (notNull(stormData_car)) {

                setSendData.car = stormData_car;

                if (stormData_car != '0') {

                    if (notNull(stormData_carappraisement)) {
                        setSendData.car_value = stormData_carappraisement;

                    } else {
                        showMassage = '请选择是车产估值';
                        defaultHint(showMassage);
                        return false
                    }


                    if (stormData_car == '1') {
                        setSendData.car_mortgage = 1;
                    }
                    if (stormData_car == '2') {
                        setSendData.car_mortgage = 0;
                    }
                    return true
                } else {
                    setSendData.car = 0;
                }

                return true

            } else {
                showMassage = '请选择名下是否有车产';
                defaultHint(showMassage);
                return false
            }
        }


        function aboutInsurance() {
            if (notNull(stormData_insurance)) {


                if (stormData_insurance != '0') {
                    setSendData.zy_insurance = 1;
                    setSendData.zy_insurance_time = stormData_insurance;


                    if (notNull(stormData_insurancevalue)) {

                        setSendData.zy_insurance_value = stormData_insurancevalue;

                    } else {
                        showMassage = '请选择保单价值';
                        defaultHint(showMassage);
                        return false
                    }

                } else {
                    setSendData.zy_insurance = 0;

                }

                return true

            } else {
                showMassage = '请选择是否有人寿保险';
                defaultHint(showMassage);
                return false
            }

        }


        function sendFN(setSendData) {



            var sendData = {};

            var identifyCode = sessionStorage.getItem('identifyCode');



            let userinfodjd = getUserInfo();
            let phoneLoginState = userinfodjd.id;


            setSendData.mobile = userinfodjd.phone;



            if (notNull(phoneLoginState)) {
                sendData = {
                    largeCredit: setSendData,
                    channel: setSendData.channel,
                    mobile: setSendData.mobile,
                    userId: phoneLoginState
                }
            } else {
                sendData = {
                    largeCredit: setSendData,
                    channel: setSendData.channel,
                    identifyCode: identifyCode,
                    mobile: setSendData.mobile
                }
            }

            myAjaxFuncJsonNotchangeToken({
                url: largeCredit + 'applyLargeCredit',
                type: "post",
                dataType: 'json',
                data: sendData,
                mySuccess: function (data) {

                    if (isResponseSuccess('success', data)) {

                        sessionStorage.removeItem('userSendData');
                        sessionStorage.removeItem('identifyCode');
                        sessionStorage.removeItem('djd_phone');

                        $('#sectiondjd').hide();
                        $('#djdcomplete').show();
                        $('#dajindai').show();

                    }else {
                        defaultHint(isResponseSuccess('msg',data));
                        window.location.href=window.location.href;

                    }

                }
            })

        }


        //
        // up1.hide();
        // up2.hide();
        //
        // up3.fadeIn();

    });





});


























